package main

import (
	"fmt"
	"math"
)

func getSquareRoot1(x float64) float64 {
	return math.Sqrt(x)
}

var getSquareRoot2 = func(x float64) float64 {
	return math.Sqrt(x)
}

type callbackFunc func(int) int

func callFunc(i int, cb callbackFunc) int {
	fmt.Println("[func|callFunc]")
	return cb(i)
}

func realFunc(i int) int {
	fmt.Println("[func|realFunc]callback function")
	return i * i
}

// func main() {
// 	num1 := 100.0
// 	res1 := getSquareRoot1(num1)
// 	fmt.Println("[func|main]res1=", res1)

// 	res2 := getSquareRoot2(num1)
// 	fmt.Println("[func|main]res2=", res2)

// 	num2 := 10
// 	res3 := callFunc(num2, realFunc)
// 	fmt.Println("[func|main]res3=", res3)
// }
